import com.sun.jdi.PathSearchingVirtualMachine;

import java.util.Scanner;

public class Main
{
    public static void main1(String[] args) {
        MyLinkedList0 m = new MyLinkedList0();
//        ["MyLinkedList","addAtHead","addAtHead","addAtHead","addAtIndex","deleteAtIndex",
//            "addAtHead","addAtTail","get","addAtHead","addAtIndex","addAtHead"]
//        [[],[7],[2],[1],[3,0],[2],
//        [6],[4],[4],[4],[5,0],[6]]


        m.addAtHead(7);
        m.addAtHead(2);
        m.addAtHead(1);
        m.addAtIndex(3, 0);
        m.printList();


        int in = 10;
        long lo = 10;
        double du = 10.24;
        float ao = 10.1f;
        byte by = 34;
        boolean bl = false;
        char ch = 24;
        short sh = 21;

        sh = by;
        in = sh;
        lo = in;
        ao = lo;
        du = ao;

        in = ch;
        lo = ch;

        by = (byte) ch;
    }

    public static void main2(String[] args) {
        System.out.println('A' - 'a');
        System.out.println('z' + 'A' - 'a');

        char letter = 'z';
        char letterUpper = (char) (letter + 'A' - 'a');

        String s = "HelloWrold";
        String s1 = s;
        s = s + "!1024";  //此处是修改 引用的指向而已。
        System.out.println(s1);
        System.out.println(s);


        //包装类从中解析出来字符串转换成需要的数，数字类型必须为纯数字。
        byte b = Byte.parseByte("13");
        int i = Integer.parseInt("1024");
        double d = Double.parseDouble("1024.663");
        System.out.println(b);
        System.out.println(i);
        System.out.println(d);
        System.out.println(d + i + b);

//        long longv = Long.parseLong("1433223wenzi文字");
//        System.out.println(longv);//这他么异常，原因是去看底层方法~，没有识别文字摘取的

        boolean bl = Boolean.parseBoolean("1024文字wenzifalse");//此处带文字也可以提取出来
        System.out.println(bl);
        /*
            public static boolean parseBoolean(String s) {
        return "true".equalsIgnoreCase(s);
    }
         */

        int intV = Integer.parseInt("100010101", 2);
        int intV1 = Integer.parseInt("101", 2);//后面的radix是根，基数的意思，将其转换成 二进制
        System.out.println(intV);
        System.out.println(intV1);

        int[] arr = {1, 1, 2, 2, 3, 3, 4};
        int diff = 0;
        for (int elem : arr) {
            diff = diff ^ elem;
        }
        System.out.println(diff);
        int a = 1 ^ 1 ^ 13 ^ 13;
        int bii = 1 ^ 1;
        int cii = 13 ^ 13 ^ 19;
        System.out.println(a);
        System.out.println(bii);
        System.out.println(cii);

        int cnt = 0;


        for (; cnt < 10; cnt++)  //语句1 ， 语句2 ，循环体 ，语句三
        {
            System.out.print(cnt + " ");
        }
        System.out.println();
        System.out.println(cnt);


        Scanner scanner = new Scanner(System.in);
        int input = scanner.nextByte();
        switch (input) {
            case 1: {
                System.out.println(1);
                break;
            }
            case 2: {
                break;
            }
            case 3: {
                break;
            }
            case 4: {
                break;
            }
            case 5: {
                break;
            }
        }
    }

    public static void main3(String[] args) {
        System.out.println("Please input the year you want to test :");

        System.out.println("您可以输入10086来中断程序！");
        while (true) {
            Scanner input = new Scanner(System.in);
            int in = input.nextInt();
            int choice = -1;
            if (in % 400 == 0) choice = 0;
            if (in == 10086) choice = -10086;
            if (in % 4 == 0 && in % 100 != 0) choice = 1;
            switch (choice) {
                case -10086: {
                    System.out.println("程序结束");
                    break;
                }
                case 0: {
                    System.out.println("是闰年");
                    break;
                }
                case 01: {
                    System.out.println("是闰年");
                    break;
                }
                default: {
                    System.out.println("不是闰年");
                    break;
                }
            }
            if (in == 10086) break;
        }

        int month = -8;
    }

    public static void main4(String[] args)
    {
        int i = 0;
        int sum =100;
        int j=0;


        System.out.println("打两个断点并设置条件的作用是 ： 点击左下角的，快进到下一个断点。" );

        int begin =0;
        int end =1024;
        while(i<10)
        {
            System.out.println("之前"+i);
            i++;
            System.out.println("之后"+i);
        }

    }


    public static void main(String[] args) {
        int i=1;
        int j = 1;
        for (; i < 10; i++)
        {
            for(int a=0;a < 9-i;a++)
            {
                System.out.printf("              ");
            }
            for (j = 1; j <= i; j++)
            {
//                System.out.print(j + " * " + i + " = " + (i * j) + "    ");
                System.out.printf("%2d * %2d = %2d  ",i,j,(i*j));
            }
            System.out.println();
        }
        System.out.println();
    }
}



class Print
{
    static void print1()
    {
//        public static int i = 1;//方法类内不允许加修饰符。
//        int i=1;
//        int j = 1;
//        for (; i < 10; i++)
//        {
//            for (j = 1; j <= i; j++)
//            {
//                for(int a=0;a < 9-i;a++)
//                {
//                    System.out.println("           ");
//                }
//
//                System.out.print(j + " * " + i + " = " + (i * j) + "    ");
//            }
//            System.out.println();
//        }
    }

}








